#!/bin/bash

##by CC
echo "------ step 1: config yum ------"
yum install -y wget vim
cd /etc/yum.repos.d/
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

echo "------ step 2: config  profile------"
echo 'export LC_ALL=C'>> /etc/profile
source /etc/profile

echo "------ step 3: stop iptables and selinux------"
/etc/init.d/iptables stop
/etc/init.d/iptables stop
chkconfig iptables off
setenforce 0
if [ -f /etc/selinux/config ]; then
    sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
    setenforce 0
fi
echo "------ step 4: config time sync------"
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
>/etc/sysconfig/clock
touch /etc/sysconfig/clock
>/etc/sysconfig/clock
echo "ZONE=“Asia/Shanghai">/etc/sysconfig/clock
#vim /etc/sysconfig/clock中 ZONE=“Asia/Shanghai”
echo "------ step 5: config time sync------"
yum install -y ntpdate
/usr/sbin/ntpdate pool.ntp.org
echo '*/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org >/dev/null 2>&1'>>/var/spool/cron/root
crontab -l
yum install -y dos2unix lrzsz gcc* gcc-c++ libstdc++-devel vim* wget ntpdate openssh-clients screen
yum update -y
